/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {                                     
    // Setup the ajax indicator
    $('body').append('<div id="ajaxBusy"><p><center><img src="../images/ajax-loader.gif"></p></center></div>');

    $('#ajaxBusy').css({        
        display:"none",
        position: "absolute",
        top: "50%",
        left: "0",
        width: "100%"
    });
});

// Ajax activity indicator bound to ajax start/stop document events
$(document).ajaxStart(function(){ 
  $('#ajaxBusy').show(); 
}).ajaxStop(function(){ 
  $('#ajaxBusy').hide();
});

function checknum() {
    var key = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if ((key<46 || key>57 || key == 47) && (key != 13)) {
        event.returnValue = false;
        alert("กรุณากรอกเบอร์โทรศัพท์เป็นตัวเลขเท่านั้น !!");
        number.focus();
    }
}            